package com.corechina.apex_osswords.common;

/**
 * 常量
 */
public class Constant {


    /**
     * 超级管理员ID
     */
    public static final int SUPER_ADMIN = 1;

    public static final String TOKEN_PREFIX = "access_token:";

    /**
     * 状态：启用
     */
    public static final int STATUS_ENABLED = 1;

    /**
     * 状态：禁用
     */
    public static final int STATUS_DISABLE = 0;

    /**
     * 输入输出类型
     */
    public enum InOutType {
        POWER(0),
        SIGNAL(1);
        private int value;

        InOutType(int value) {
            this.value = value;
        }

        public int getValue() {
            return value;
        }

        public static InOutType getByValue(int value) {
            for (InOutType inOutType : values()) {
                if (inOutType.getValue() == value) {
                    return inOutType;
                }
            }
            return null;
        }
    }

    /**
     * 登录类型
     */
    public enum LoginType {
        /**
         * 客户端登录
         */
        CLIENT_LOGIN(0, "客户端登录"),
        /**
         * 微信公众号登录
         */
        WOA_LOGIN(1, "微信公众号登录"),
        /**
         * app微信登录
         */
        APP_WX_LOGIN(2, "App微信登录"),
        /**
         * appQQ登录
         */
        APP_QQ_LOGIN(3, "AppQQ登录");

        private int code;
        private String value;

        LoginType(int code, String value) {
            this.code = code;
            this.value = value;
        }

        public String getValue() {
            return value;
        }

        public int getCode() {
            return code;
        }
    }

    /**
     * 菜单类型
     */
    public enum MenuType {
        /**
         * 目录
         */
        CATALOG(0),
        /**
         * 菜单
         */
        MENU(1),
        /**
         * 按钮
         */
        BUTTON(2);

        private int value;

        MenuType(int value) {
            this.value = value;
        }

        public int getValue() {
            return value;
        }
    }

    /**
     * 部门类型
     */
    public enum DEPARTMENTS_TYPE {
        /**
         * 部门
         */
        DEPARTMENTS(0),
        /**
         * 用户组
         */
        USER_GROUPS(1);

        private int value;

        DEPARTMENTS_TYPE(int value) {
            this.value = value;
        }

        public int getValue() {
            return value;
        }
    }
}
